<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>
    // sessionStorage 和localStorage 
    // sessionStorage 回话存储 临时存储  关闭浏览器 自动清除
    // 5M左右存储空间
    //  1 . 设置临时存储
    sessionStorage.color = "red";
    sessionStorage.setItem("price", "10亿")
    // 2获取临时存储
    document.write(sessionStorage.color)
    document.write(sessionStorage.getItem("price"))
    // 3删除存储
    sessionStorage.removeItem("price")
    // 4 清空存储
    sessionStorage.clear()
  </script>
</body>

</html>